<?php
class Enums extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$data = array ();
		$type = rqst ( 'type', 'keyword' );
		$enums = apply_filter ( 'get_web_enums', array () );
		if (! isset ( $enums [$type] )) {
			exit ();
		}
		$eM = new WebEnumModel ();
		$items = $eM->getEnums ( $type );
		$data ['items'] = $items ? $items : array ();
		$data ['enum_title'] = $enums [$type];
		$data ['labels'] = array ('','label-success','label-warning','label-important','label-info','label-inverse' );
		$data ['enum'] = $type;
		return new SmartyView ( $data, 'enum/Enums' );
	}
}